#include "StdAfx.h"
#include "sa_TwSmapleMgr.h"
#include "TwSampleHead.h"

sa_TwSmapleMgr::sa_TwSmapleMgr(void):
m_pkTextFilter(0)
,m_pkMeshLoad(0)
,m_pkMeshFile(0)
,m_pkTextureMesh(0)
,m_pkSprite(0)
,m_pkSpriteMore(0)
,m_pkSpriteAnmation(0)
,m_pkFont(0)
,m_pkPick(0)
,m_pkShader(0)
,m_pkBillBoard(0)
,m_pkPartilce(0)
,m_pkParticleEm(0)
{
}

sa_TwSmapleMgr::~sa_TwSmapleMgr(void)
{
}
void  sa_TwSmapleMgr::InitGraphics()
{
	//m_pkTextFilter = new sa_TwTexureFilter();
	//m_pkTextFilter->InitGraphics();

	//m_pkMeshLoad = new sa_TwMeshLoad();
	//m_pkMeshLoad->InitGraphics();

	//m_pkMeshFile = new sa_TwMeshFile();
	//m_pkMeshFile->InitGraphics();

	//m_pkTextureMesh = new sa_TwTextureMesh();
	//m_pkTextureMesh->InitGraphics();

	//m_pkSprite = new sa_TwSprite();
	//m_pkSprite->InitGraphics();

	//m_pkSpriteMore = new sa_TwSpriteMore();
	//m_pkSpriteMore->InitGraphics();

	//m_pkSpriteAnmation = new sa_TwSpriteAnimation();
	//m_pkSpriteAnmation->InitGraphics();

	//m_pkFont = new sa_TwFont();
	//m_pkFont->Init();

	//m_pkPick = new sa_TwPick();
	//m_pkPick->InitGraphics();

	//m_pkShader = new sa_TwShader();
	//m_pkShader->InitGraphics();

	//m_pkBillBoard = new sa_TwBillBoard();
	//m_pkBillBoard->InitGraphics();

	//m_pkPartilce = new sa_TwParticle();
	//m_pkPartilce->InitGraphics();

	m_pkParticleEm = new sa_TwParticleEmission();
	m_pkParticleEm->InitGraphics();
}
void  sa_TwSmapleMgr::Update()
{
	if(m_pkTextFilter)
		m_pkTextFilter->Update();
	if(m_pkMeshLoad)
		m_pkMeshLoad->Update();
	if(m_pkMeshFile)
		m_pkMeshFile->Update();
	if(m_pkTextureMesh)
		m_pkTextureMesh->Update();
	if(m_pkSprite)
		m_pkSprite->Update();

	if (m_pkSpriteMore)
		m_pkSpriteMore->Update();

	if(m_pkSpriteAnmation)
		m_pkSpriteAnmation->Update();

	if(m_pkPick)
		m_pkPick->Update();

	if(m_pkShader)
		m_pkShader->Update();
	if(m_pkBillBoard)
		m_pkBillBoard->Update();

	if(m_pkPartilce)
		m_pkPartilce->Update();

	if(m_pkParticleEm)
		m_pkParticleEm->Update();
}
void  sa_TwSmapleMgr::Render()
{
	if(m_pkTextFilter)
		m_pkTextFilter->Render();
	if(m_pkMeshLoad)
		m_pkMeshLoad->Render();
	if(m_pkMeshFile)
		m_pkMeshFile->Render();
	if(m_pkTextureMesh)
		m_pkTextureMesh->Render();
	if(m_pkSprite)
		m_pkSprite->Render();
	if (m_pkSpriteMore)
		m_pkSpriteMore->Render();
	if(m_pkSpriteAnmation)
		m_pkSpriteAnmation->Render();
	if(m_pkFont)
		m_pkFont->Render();
	if(m_pkPick)
		m_pkPick->Render();
	if(m_pkShader)
		m_pkShader->Render();
	if(m_pkBillBoard)
		m_pkBillBoard->Render();
	if(m_pkPartilce)
		m_pkPartilce->Render();
	if(m_pkParticleEm)
		m_pkParticleEm->Render();
}
void  sa_TwSmapleMgr::Clear()
{
	if(m_pkTextFilter)
	{
		m_pkTextFilter->Clear();
		delete m_pkTextFilter;
		m_pkTextFilter = NULL;
	}

	if(m_pkMeshLoad)
	{
		m_pkMeshLoad->Clear();
		delete m_pkMeshLoad;
		m_pkMeshLoad = NULL;
	}
	if(m_pkMeshFile)
	{
		m_pkMeshFile->Clear();
		delete m_pkMeshFile;
		m_pkMeshFile = NULL;
	}
	if(m_pkTextureMesh)
	{
		m_pkTextureMesh->Clear();
		delete m_pkTextureMesh;
		m_pkTextureMesh = NULL;
	}
	if(m_pkSprite)
	{
		m_pkSprite->Clear();
		delete m_pkSprite;
		m_pkSprite = NULL;
	}
	if (m_pkSpriteMore)
	{
		m_pkSpriteMore->Clear();
		delete m_pkSpriteMore;
		m_pkSpriteMore = NULL;
	}
	if(m_pkSpriteAnmation)
	{
		m_pkSpriteAnmation->Clear();
		delete m_pkSpriteAnmation;
		m_pkSpriteAnmation = NULL;
	}

	if(m_pkPick)
	{
		m_pkPick->Clear();
		delete m_pkPick;
		m_pkPick = NULL;
	}

	if(m_pkShader)
	{
		m_pkShader->Clear();
		delete m_pkShader;
		m_pkShader = NULL;
	}
	if(m_pkBillBoard)
	{
		m_pkBillBoard->Clear();
		delete m_pkBillBoard;
		m_pkBillBoard = NULL;
	}
	if(m_pkPartilce)
	{
		m_pkPartilce->Clear();
		delete m_pkPartilce;
		m_pkPartilce = NULL;
	}
	if(m_pkParticleEm)
	{
		m_pkParticleEm->Clear();
		delete m_pkParticleEm;
		m_pkParticleEm = NULL;
	}
}